<?php

class ZFDulcet_Grid extends Bvb_Grid_Deploy_Table {

    public static $_loadDefaultTemplate = true;

    /**
     * Retorna o objeto Grid Table
     *
     * @param string $gridName Nome da grid
     * @param Zend_Config|array $options Opcoes da grid
     * @param string $id Id da Grid
     * @return ZFDulcet_Grid_Deploy_Table
     */
    public static function myFactory($gridName, $options = array(), $id = '') {
        $options['id'] = $id;
        $grid = Bvb_Grid::factory('ZFDulcet_Grid_Deploy_Table', $options);
        $grid->setGridId($id);
        $grid->setNameGrid($gridName);

        if (self::$_loadDefaultTemplate) {
            $grid->addTemplateDir(PATH_ZFEXTEND . '/ZFDulcet/Grid/Template', 'ZFDulcet_Grid_Template', 'table');
            $grid->setTemplate('Table', 'table');
        }

        $grid->addFormatterDir(PATH_ZFEXTEND . '/ZFDulcet/Grid/Formatter', 'ZFDulcet_Grid_Formatter');
        $grid->addFormatterDir(PATH_ZC . '/Admin/Grid/Formatter', 'ZC_Admin_Grid_Formatter');
        $grid->addFormatterDir(PATH_ZFEXTEND . '/ZFKiller/Grid/Formatter', 'ZFKiller_Grid_Formatter');

        $grid
                ->setAlwaysShowOrderArrows(false)
                ->setNoFilters(true)
                ->setExport(array())
                ->setRecordsPerPage(15)
                ->setImagesUrl(ZFDULCET_LIB_DIR_IMG . '/famfamfam/')
        ;

        return $grid;
    }
    
}